package Enclosure;

import java.util.ArrayList;

public class Enclosure implements IEnclosure {
    private int enclosureId;
    private String enclosureName;
    private int enclosureSize;
    private int enclosureTypeId;
    private String enclosureType;
    private String exhibitName;
    private String exhibitDesc;
    int numEnclosureEntries;
    boolean isEnclosureLightsOn;
    boolean isEnclosureLocked;
    boolean enclosureHasAnimal;
    boolean enclosureHasPerson;
    private ArrayList<Entry> entries = new ArrayList<Entry>();


    public Enclosure(int enclosureId, String enclosureName, int enclosureSize, int enclosureTypeId, String enclosureType, String exhibitName, String exhibitDesc, int numEnclosureEntries, boolean isEnclosureLightsOn, boolean isEnclosureLocked, boolean enclosureHasAnimal, boolean enclosureHasPerson) {
        this.enclosureId = enclosureId;
        this.enclosureName = enclosureName;
        this.enclosureSize = enclosureSize;
        this.enclosureTypeId = enclosureTypeId;
        this.enclosureType = enclosureType;
        this.exhibitName = exhibitName;
        this.exhibitDesc = exhibitDesc;
        this.numEnclosureEntries = numEnclosureEntries;
        this.isEnclosureLightsOn = isEnclosureLightsOn;
        this.isEnclosureLocked = isEnclosureLocked;
        this.enclosureHasAnimal = enclosureHasAnimal;
        this.enclosureHasPerson = enclosureHasPerson;
    }


    @Override
    public int getEnclosureId() {
        return enclosureId;
    }


    @Override
    public String getEnclosureName() {
        return enclosureName;
    }


    @Override
    public int getEnclosureSize() {
        return enclosureSize;
    }


    @Override
    public int getEnclosureTypeId() {
        return enclosureTypeId;
    }


    @Override
    public String getEnclosureType() {
        return enclosureType;
    }


    @Override
    public String getExhibitName() {
        return exhibitName;
    }


    @Override
    public String getExhibitDesc() {
        return exhibitDesc;
    }


    @Override
    public int getNumEnclosureEntries() {
        return numEnclosureEntries;
    }


    @Override
    public ArrayList<Entry> getEnclosureEntries() {
        return entries;
    }


    @Override
    public void addEnclosureEntry(Entry entry) {
        entries.add(entry);
    }


    @Override
    public void closeAllEnclosureEntries() {
        for (Entry entry : entries) {
            entry.closeEntry();
        }
    }


    @Override
    public Boolean isEnclosureLightsOn() {
        return isEnclosureLightsOn;
    }


    @Override
    public void switchEnclosureLightsOn() {
        isEnclosureLightsOn = true;
    }


    @Override
    public void switchEnclosureLightsOff() {
        isEnclosureLightsOn = false;
    }


    @Override
    public Boolean isEnclosureLocked() {
        return isEnclosureLocked;
    }


    @Override
    public void lockEnclosure() {
        isEnclosureLocked = true;
    }


    @Override
    public void unlockEnclosure() {
        isEnclosureLocked = false;
    }


    @Override
    public Boolean isEnclosureOccupiedByAnimal() {
        return enclosureHasAnimal;
    }


    @Override
    public void setEnclosureOccupiedByAnimal() {
        enclosureHasAnimal = true;
    }


    @Override
    public void setEnclosureUnoccupiedByAnimal() {
        enclosureHasAnimal = false;
    }


    @Override
    public Boolean isEnclosureOccupiedByPerson() {
        return enclosureHasPerson;
    }


    @Override
    public void setEnclosureOccupiedByPerson() {
        enclosureHasPerson = true;
    }


    @Override
    public void setEnclosureUnoccupiedByPerson() {
        enclosureHasPerson = false;
    }
}
